package cn.sc.allinpay.allfavour.business.common.data;

import android.os.Parcel;
import android.os.Parcelable;

import com.j256.ormlite.field.DataType;
import com.j256.ormlite.field.DatabaseField;

/**
 * description：售券记录
 * author：pany
 * on 2018/10/29 15:32
 */
public class SaleCouponRecord implements Parcelable {

    @DatabaseField(generatedId = true)
    public int id;

    @DatabaseField(columnName = "TRANSNO", unique = true)
    public String transNo;//流水号

    @DatabaseField(columnName = "SEQNUM")
    public String seqNum;//序列号

    @DatabaseField(columnName = "ORDERID")
    public String orderId;//订单号,营销前置订单

    @DatabaseField(columnName = "TRANSAMT")
    public String transAmt;//交易金额

    @DatabaseField(columnName = "TRANSDATE")
    public String transDate;//交易日期

    @DatabaseField(columnName = "TRANSTIME")
    public String transTime;//交易时间

    @DatabaseField(columnName = "TRANSTYPE")
    public String transType;//交易方式

    @DatabaseField(columnName = "STATE")
    private int state = 0;//支付状态  0：支付中 1:支付成功

    @DatabaseField(columnName = "SELLSTATE")
    private int sellState = 0;//销账状态  0:销账中 1:销账成功

    @DatabaseField(columnName = "COUPONNAME")
    private String couponName;//售券名称

    @DatabaseField(columnName = "COUPONNUM")
    private int couponNum;//售券数量

    @DatabaseField(columnName = "COUPONTYPE")
    private int couponType;//售券类型

    @DatabaseField(columnName = "COUPONPRICE")
    private String couponPrice;//售价

    @DatabaseField(columnName = "COUPONUNIT")
    private String couponUnit;//单位

    @DatabaseField(columnName = "OPERATOR")
    private String operator;//操作员

    @DatabaseField(columnName = "OPERATORNAME")
    private String operatorName;//操作员名称

    @DatabaseField(columnName = "DESC")
    private String desc;//扩展字段，暂时未用

    /************************售券详情**************************/
    @DatabaseField(columnName = "SALECOUPONDATA", canBeNull = true, dataType = DataType.LONG_STRING)
    private String saleCouponData;//就是SaleCouponData对象的json

    /************************pos支付详情**************************/
    @DatabaseField(columnName = "POSDATA", canBeNull = true, dataType = DataType.LONG_STRING)
    private String posData;//就是PosData对象的json


    public SaleCouponRecord() {

    }


    protected SaleCouponRecord(Parcel in) {
        id = in.readInt();
        transNo = in.readString();
        seqNum = in.readString();
        orderId = in.readString();
        transAmt = in.readString();
        transDate = in.readString();
        transTime = in.readString();
        transType = in.readString();
        state = in.readInt();
        sellState = in.readInt();
        couponName = in.readString();
        couponNum = in.readInt();
        couponType = in.readInt();
        couponPrice = in.readString();
        couponUnit = in.readString();
        operator = in.readString();
        operatorName = in.readString();
        desc = in.readString();
        saleCouponData = in.readString();
        posData = in.readString();
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getTransNo() {
        return transNo;
    }

    public void setTransNo(String transNo) {
        this.transNo = transNo;
    }

    public String getSeqNum() {
        return seqNum;
    }

    public void setSeqNum(String seqNum) {
        this.seqNum = seqNum;
    }

    public String getOrderId() {
        return orderId;
    }

    public void setOrderId(String orderId) {
        this.orderId = orderId;
    }

    public String getTransAmt() {
        return transAmt;
    }

    public void setTransAmt(String transAmt) {
        this.transAmt = transAmt;
    }

    public String getTransDate() {
        return transDate;
    }

    public void setTransDate(String transDate) {
        this.transDate = transDate;
    }

    public String getTransTime() {
        return transTime;
    }

    public void setTransTime(String transTime) {
        this.transTime = transTime;
    }

    public String getTransType() {
        return transType;
    }

    public void setTransType(String transType) {
        this.transType = transType;
    }

    public int getState() {
        return state;
    }

    public void setState(int state) {
        this.state = state;
    }

    public int getSellState() {
        return sellState;
    }

    public void setSellState(int sellState) {
        this.sellState = sellState;
    }

    public String getCouponName() {
        return couponName;
    }

    public void setCouponName(String couponName) {
        this.couponName = couponName;
    }

    public int getCouponNum() {
        return couponNum;
    }

    public void setCouponNum(int couponNum) {
        this.couponNum = couponNum;
    }

    public int getCouponType() {
        return couponType;
    }

    public void setCouponType(int couponType) {
        this.couponType = couponType;
    }

    public String getCouponPrice() {
        return couponPrice;
    }

    public void setCouponPrice(String couponPrice) {
        this.couponPrice = couponPrice;
    }

    public String getCouponUnit() {
        return couponUnit;
    }

    public void setCouponUnit(String couponUnit) {
        this.couponUnit = couponUnit;
    }

    public String getOperator() {
        return operator;
    }

    public void setOperator(String operator) {
        this.operator = operator;
    }

    public String getOperatorName() {
        return operatorName;
    }

    public void setOperatorName(String operatorName) {
        this.operatorName = operatorName;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    public String getSaleCouponData() {
        return saleCouponData;
    }

    public void setSaleCouponData(String saleCouponData) {
        this.saleCouponData = saleCouponData;
    }

    public String getPosData() {
        return posData;
    }

    public void setPosData(String posData) {
        this.posData = posData;
    }

    public static final Creator<SaleCouponRecord> CREATOR = new Creator<SaleCouponRecord>() {
        @Override
        public SaleCouponRecord createFromParcel(Parcel in) {
            return new SaleCouponRecord(in);
        }

        @Override
        public SaleCouponRecord[] newArray(int size) {
            return new SaleCouponRecord[size];
        }
    };

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel parcel, int i) {
        parcel.writeInt(id);
        parcel.writeString(transNo);
        parcel.writeString(seqNum);
        parcel.writeString(orderId);
        parcel.writeString(transAmt);
        parcel.writeString(transDate);
        parcel.writeString(transTime);
        parcel.writeString(transType);
        parcel.writeInt(state);
        parcel.writeInt(sellState);
        parcel.writeString(couponName);
        parcel.writeInt(couponNum);
        parcel.writeInt(couponType);
        parcel.writeString(couponPrice);
        parcel.writeString(couponUnit);
        parcel.writeString(operator);
        parcel.writeString(operatorName);
        parcel.writeString(desc);
        parcel.writeString(saleCouponData);
        parcel.writeString(posData);
    }
}
